package com.yuandian.api.management.feign;

import com.yuandian.api.management.entity.ConfGraph;
import com.yuandian.api.management.entity.ConfSegment;
import com.yuandian.bpm.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * 说明：远程调用选项接口服务
 * @Author zfsn
 * @Date 2023/3/14 16:06
 */
@FeignClient(contextId = "RemoteSegmentService", value = "bpm-management")
public interface RemoteSegmentService {


	/**
	 * 通过系统主键查询数据
	 * @param systemId 主键集合
	 * @return 通用返回对象
	 */
	@GetMapping("/segment/getSegmentsBySystemId/{systemIds}")
	R<List<ConfSegment>> queryByIds(@PathVariable("systemIds") List<Integer> systemId);

	/**
	 * 获取网端类型名称
	 * @param segmentId 主键集合
	 * @return 通用返回对象
	 */
	@GetMapping("/segment/getSegmentTypeNameBySegmentId/{segmentId}")
	R<ConfSegment> getSegmentTypeNameBySegmentId(@PathVariable("segmentId") Integer segmentId);

	/**
	 * 获取节点位置
	 * @param confGraph 筛选条件
	 * @return 通用返回对象
	 */
	@PostMapping("/graph/getNodePosition")
	R<List<ConfGraph>> getPosition(ConfGraph confGraph);

	/**
	 * 新增节点数据
	 * @param confGraph 实例对象
	 * @return 通用返回对象
	 */
	@PostMapping("/graph/addNode")
	R<Boolean> addNode(ConfGraph confGraph);


	/**
	 * 更新节点数据
	 * @param confGraph 实例对象
	 * @return 通用返回对象
	 */
	@GetMapping("/graph/updateNode")
	R<Boolean> updateNode(ConfGraph confGraph);


	/**
	 * 删除节点信息
	 * @param confGraph 筛选条件
	 * @return 通用返回对象
	 */
	@PostMapping("/deleteNode")
	R<Boolean> deleteNode(ConfGraph confGraph);

}
